FROM openanolis/anolisos:8.6

LABEL \
        org.opencontainers.image.title=openjdk \
        org.opencontainers.image.version=17-8.6

RUN yum -y update \
    && yum -y install java-17-openjdk java-17-openjdk-devel \
    && yum clean all

ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk

RUN set -eux; \
# https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472
        find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \
        ldconfig; \
        java -version; \
        javac -version

CMD ["jshell"]
